package com.atguigu.java.ai.langchain4j.tools;

import dev.langchain4j.agent.tool.P;
import dev.langchain4j.agent.tool.Tool;
import dev.langchain4j.agent.tool.ToolMemoryId;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @Author: zhang
 * @Date: 2025/9/1 15:34
 * @Description:
 **/
@Component
public class CalculatorTools {
    @Tool
    double sum (@ToolMemoryId int memory, double a , double b ){
        System.out.println("调用加法运算");
        return a+b;
    }

    @Tool
    double subtraction (@ToolMemoryId int memory,double a , double b ){
        System.out.println("调用减法运算");
        return a-b;
    }

    @Tool
    double squareRoot(@ToolMemoryId int memory,double x){
        System.out.println("调用平方根运算");
        return Math.sqrt(x);
    }
}
